<template>
	<div>
		<el-row :gutter="20">
			<el-col :span="24" style="margin-bottom: 20px"><Userinfo /></el-col>
			<el-col :span="6"><MyNews v-if="tableData.length" :data="tableData" /></el-col>
			<el-col :span="6"><MyResources v-if="tableData.length" :data="tableData" /></el-col>
			<el-col :span="6" v-if="webMenu.filter(v => v.id == 876).length == 1"><MyArticle v-if="tableData.length" :data="tableData" /></el-col>
		</el-row>
	</div>
</template>
<script>
import { homeStatHomeInfo } from '@/api/http';
export default {
	components: {
		Userinfo: () => import('./Userinfo.vue'),
		MyNews: () => import('./MyNews.vue'),
		MyResources: () => import('./MyResources.vue'),
		MyArticle: () => import('./MyArticle.vue')
	},
	data() {
		return {
			webMenu: [],
			tableData: []
		};
	},
	mounted() {
		this.webMenu = JSON.parse(this.getSession('webMenu'));
		this.getInfo();
	},
	methods: {
		getInfo() {
			homeStatHomeInfo().then(res => {
				this.tableData = res.data.data;
			});
		}
	}
};
</script>
<style scoped lang="scss"></style>
